/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.us.ij.plugins.segmentation.commands.watershed;

import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author Przemek
 */
public class FifoQueue {
        
    List<WatershedPixel> queue = new LinkedList<WatershedPixel>();

        public int getCount() {

            return queue.size();
        }

        public void AddToEnd(WatershedPixel p)
        {
            queue.add(p);
        }

        public WatershedPixel RemoveAtFront()
        {
            WatershedPixel temp = queue.get(0);
            queue.remove(0);
            return temp;
        }

        public boolean isEmpty() {
            return (queue.size() == 0);
        }

        public String toString()
        {
            return toString() + " Count = " + new Integer(queue.size()).toString();
        }
}
